|
@@ -24,6 +24,7 @@ Page({
|
|
menuList: [
|
|
menuList: [
|
|
{ name: '审批', imgUrl: '../../../image/sp.png', url: '../my_approve/my_approve', code: 'creator admin' },
|
|
{ name: '审批', imgUrl: '../../../image/sp.png', url: '../my_approve/my_approve', code: 'creator admin' },
|
|
{ name: '任务', imgUrl: '../../../image/a7.png', url: '../../statistics/my_task/my_task', code: 'admin employee' },
|
|
{ name: '任务', imgUrl: '../../../image/a7.png', url: '../../statistics/my_task/my_task', code: 'admin employee' },
|
|
|
|
+ { name: '复核', imgUrl: '../../../image/fuhe.png', url: '../review/review', code: 'creator admin' },
|
|
{ name: '奖扣B分', imgUrl: '../../../image/point_entry.png', url: '../jk_B/jk_B?type=B', code: 'creator admin' },
|
|
{ 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/my_publish.png', url: '../../statistics/assaign/assaign', code: 'creator admin' },
|
|
{ name: '申请积分', imgUrl: '../../../image/a_apply.png', url: '../apply/apply', code: 'admin employee' },
|
|
{ name: '申请积分', imgUrl: '../../../image/a_apply.png', url: '../apply/apply', code: 'admin employee' },
|
|
@@ -31,7 +32,6 @@ Page({
|
|
{ name: '领任务', imgUrl: '../../../image/task_hall.png', url: '../../statistics/getTask/getTask', code: 'admin employee' },
|
|
{ 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/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/add_ticket.png', url: '../../statistics/grant/grant', code: 'creator admin' },
|
|
- // { name: '福利兑换', imgUrl: '../../../image/fl.png', url: '../../exchange/exchange/exchange', code: 'creator admin employee' },
|
|
|
|
{ name: '全部', imgUrl: '../../../image/all2.png', url: 'all', code: 'creator admin employee' },
|
|
{ name: '全部', imgUrl: '../../../image/all2.png', url: 'all', code: 'creator admin employee' },
|
|
],
|
|
],
|
|
isUpdate: false,
|
|
isUpdate: false,
|
|
@@ -58,6 +58,7 @@ Page({
|
|
that.getUserData();
|
|
that.getUserData();
|
|
that.getGg();
|
|
that.getGg();
|
|
that.getNotice();
|
|
that.getNotice();
|
|
|
|
+ that.opneWebSocket();
|
|
let isShowYy=false;
|
|
let isShowYy=false;
|
|
app.globalData.userData.employee_detail.role_list.forEach(item=>{
|
|
app.globalData.userData.employee_detail.role_list.forEach(item=>{
|
|
if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
|
|
if(item.name=='admin'||item.name=='creator'|| item.name == 'point_manager'){
|
|
@@ -99,6 +100,7 @@ Page({
|
|
that.getUserData();
|
|
that.getUserData();
|
|
that.getGg();
|
|
that.getGg();
|
|
that.getNotice();
|
|
that.getNotice();
|
|
|
|
+ that.opneWebSocket();
|
|
if(!getCache('init_rule_check')){
|
|
if(!getCache('init_rule_check')){
|
|
app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
|
|
app.globalData.userData.init_rule_check? '':that.setData({ isGz: true})
|
|
}
|
|
}
|
|
@@ -156,6 +158,26 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ opneWebSocket() {
|
|
|
|
+ let data={type:"es_info",recorder_id:app.globalData.userData.id,month:app.globalData.month};
|
|
|
|
+ app.globalData.socketApi.sendData(data, (res) => {
|
|
|
|
+ if (res.code == 1&&res.type=='es_info') {
|
|
|
|
+ let data = res.result;
|
|
|
|
+ var task = data.task;
|
|
|
|
+ var ratio = task.ratio.enable== 0 ? '-' : `${task.ratio.reward_ratio}:1`
|
|
|
|
+ var target_ratio = task.ratio.target <= 0 ? '0:0' : `${task.ratio.target}:1`
|
|
|
|
+ data.ratio = {
|
|
|
|
+ ratio: ratio,
|
|
|
|
+ target_ratio: target_ratio
|
|
|
|
+ }
|
|
|
|
+ that.getLsit();
|
|
|
|
+ that.setData({
|
|
|
|
+ userData: data
|
|
|
|
+ })
|
|
|
|
+ app.globalData.socketApi.closewebsocket();
|
|
|
|
+ }
|
|
|
|
+ }, true);
|
|
|
|
+ },
|
|
openWs(){
|
|
openWs(){
|
|
if(!that.data.islog){
|
|
if(!that.data.islog){
|
|
return false;
|
|
return false;
|
|
@@ -165,6 +187,7 @@ Page({
|
|
})
|
|
})
|
|
app.globalData.socketApi.sendData({type:'init_rule'}, function(e){
|
|
app.globalData.socketApi.sendData({type:'init_rule'}, function(e){
|
|
that.setData({islog:true})
|
|
that.setData({islog:true})
|
|
|
|
+ setCache('init_rule_check',true)
|
|
if (e.type == 'init_rule') {
|
|
if (e.type == 'init_rule') {
|
|
if(e.code==1&&e.result.done){
|
|
if(e.code==1&&e.result.done){
|
|
that.setData({ isGz:false})
|
|
that.setData({ isGz:false})
|
|
@@ -262,8 +285,16 @@ Page({
|
|
setMenuList(str) {
|
|
setMenuList(str) {
|
|
var arr = [];
|
|
var arr = [];
|
|
that.data.menuList.forEach(item => {
|
|
that.data.menuList.forEach(item => {
|
|
- if (item.code.indexOf(str) >= 0) {
|
|
|
|
- arr.push(item)
|
|
|
|
|
|
+ if(item.name=='复核'){
|
|
|
|
+ app.globalData.userData.employee_detail.role_list.forEach(e=>{
|
|
|
|
+ if(e.name=='admin'||e.name=='creator'|| e.name == 'point_manager'){
|
|
|
|
+ arr.push(item)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ if (item.code.indexOf(str) >= 0) {
|
|
|
|
+ arr.push(item)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
that.setData({
|
|
that.setData({
|
|
@@ -458,7 +489,7 @@ Page({
|
|
month: app.globalData.month,
|
|
month: app.globalData.month,
|
|
page: 1,
|
|
page: 1,
|
|
page_size: 5,
|
|
page_size: 5,
|
|
- order_key:'update_time',
|
|
|
|
|
|
+ order_key:'update_time',
|
|
employee_ids: app.globalData.isCreator ? '' : app.globalData.userData.id
|
|
employee_ids: app.globalData.isCreator ? '' : app.globalData.userData.id
|
|
})
|
|
})
|
|
var http3 = app.$get2("api/integral/review/list", { type: 'waiting', source_type: 0, page: 1, pt_id: 0 })
|
|
var http3 = app.$get2("api/integral/review/list", { type: 'waiting', source_type: 0, page: 1, pt_id: 0 })
|
|
@@ -470,18 +501,18 @@ Page({
|
|
|
|
|
|
Promise.all([http1, http2, http3, ranking, task, work, headDayBs,config]).then(function (values) {
|
|
Promise.all([http1, http2, http3, ranking, task, work, headDayBs,config]).then(function (values) {
|
|
if (values[0]) {
|
|
if (values[0]) {
|
|
- let data = values[0].data.data;
|
|
|
|
- var task = data.task;
|
|
|
|
- var ratio = task.reward.point === 0 || task.deduction.point === 0 ? '-' : `${task.ratio.ratio}:1`
|
|
|
|
- var target_ratio = task.ratio.target_ratio <= 0 ? '0:0' : `${task.ratio.target_ratio}:1`
|
|
|
|
- data.ratio = {
|
|
|
|
- ratio: ratio,
|
|
|
|
- target_ratio: target_ratio
|
|
|
|
- }
|
|
|
|
- that.getLsit();
|
|
|
|
- that.setData({
|
|
|
|
- userData: data
|
|
|
|
- })
|
|
|
|
|
|
+ // let data = values[0].data.data;
|
|
|
|
+ // var task = data.task;
|
|
|
|
+ // var ratio = task.reward.point === 0 || task.deduction.point === 0 ? '-' : `${task.ratio.ratio}:1`
|
|
|
|
+ // var target_ratio = task.ratio.target_ratio <= 0 ? '0:0' : `${task.ratio.target_ratio}:1`
|
|
|
|
+ // data.ratio = {
|
|
|
|
+ // ratio: ratio,
|
|
|
|
+ // target_ratio: target_ratio
|
|
|
|
+ // }
|
|
|
|
+ // that.getLsit();
|
|
|
|
+ // that.setData({
|
|
|
|
+ // userData: data
|
|
|
|
+ // })
|
|
}
|
|
}
|
|
if (values[1]) {
|
|
if (values[1]) {
|
|
let data = values[1].data.data.list;
|
|
let data = values[1].data.data.list;
|
|
@@ -528,7 +559,7 @@ Page({
|
|
}]
|
|
}]
|
|
employees.push(...obj)
|
|
employees.push(...obj)
|
|
})
|
|
})
|
|
- chart3.changeData(employees);
|
|
|
|
|
|
+ // chart3.changeData(employees);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|