微信点击已审批模版消息进入界面显示修改
This commit is contained in:
parent
d5df45e8fb
commit
bb46aa4745
|
@ -208,9 +208,10 @@ module Mobile
|
|||
authenticate!
|
||||
|
||||
cs = CoursesService.new
|
||||
reviewer = cs.get_reviewer_info(params)
|
||||
present :data, reviewer, with: Mobile::Entities::User
|
||||
present :status, 0
|
||||
result = cs.get_reviewer_info(params)
|
||||
|
||||
present :data, result[:reviewer], with: Mobile::Entities::User
|
||||
present :status,result[:status]
|
||||
end
|
||||
|
||||
desc "处理教师或助教的身份申请"
|
||||
|
|
|
@ -207,9 +207,9 @@ module Mobile
|
|||
authenticate!
|
||||
|
||||
ps = ProjectsService.new
|
||||
reviewer = ps.get_reviewer_info params
|
||||
present :data, reviewer, with: Mobile::Entities::User
|
||||
present :status, 0
|
||||
result = ps.get_reviewer_info(params,current_user)
|
||||
present :data, result[:reviewer], with: Mobile::Entities::User
|
||||
present :status, result[:status]
|
||||
end
|
||||
|
||||
desc "处理管理或开发的身份申请"
|
||||
|
|
|
@ -152,12 +152,14 @@ class CoursesService
|
|||
end
|
||||
|
||||
def get_reviewer_info params
|
||||
status = -1
|
||||
info = nil
|
||||
c = Course.find(params[:course_id])
|
||||
if c
|
||||
messages = CourseMessage.where("course_id=? and course_message_id = ? and course_message_type = 'JoinCourseRequest' and status = 0 ",params[:course_id],params[:user_id]).first
|
||||
|
||||
messages = CourseMessage.where("course_id=? and course_message_id = ? and course_message_type = 'JoinCourseRequest' ",params[:course_id],params[:user_id]).last
|
||||
if messages
|
||||
#status 0未处理 1同意 2 通过
|
||||
status = messages.status
|
||||
user = User.find(params[:user_id])
|
||||
if user
|
||||
img_url = url_to_avatar(user)
|
||||
|
@ -175,7 +177,7 @@ class CoursesService
|
|||
end
|
||||
end
|
||||
|
||||
info
|
||||
{status:status,reviewer:info}
|
||||
end
|
||||
|
||||
def deal_join_apply params,current_user
|
||||
|
|
|
@ -198,12 +198,16 @@ class ProjectsService
|
|||
review_members
|
||||
end
|
||||
|
||||
def get_reviewer_info params
|
||||
def get_reviewer_info params,current_user
|
||||
status = -1
|
||||
info = nil
|
||||
project = Project.find(params[:project_id])
|
||||
if project
|
||||
messages = AppliedProject.where(:project_id=> project.id, :user_id=>params[:user_id]).first
|
||||
if messages
|
||||
# messages = AppliedProject.where(:project_id=> project.id, :user_id=>params[:user_id]).first
|
||||
#status 1未处理 5拒绝 7同意
|
||||
applied_message = AppliedMessage.where(:user_id => current_user.id, :project_id => project.id, :applied_user_id=>params[:user_id],:applied_type => "AppliedProject").last
|
||||
if applied_message
|
||||
status = applied_message.status
|
||||
user = User.find(params[:user_id])
|
||||
if user
|
||||
img_url = url_to_avatar(user)
|
||||
|
@ -214,13 +218,13 @@ class ProjectsService
|
|||
:work_unit => work_unit, :mail => user.mail, :location => location,
|
||||
role_name: "",
|
||||
name: user.show_name,
|
||||
roles_id: messages.role,
|
||||
roles_id: applied_message.role,
|
||||
:brief_introduction => user.user_extensions.brief_introduction,:realname=>user.realname}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
info
|
||||
{status:status,reviewer:info}
|
||||
end
|
||||
|
||||
def deal_join_apply params,current_user
|
||||
|
|
|
@ -1,16 +1,30 @@
|
|||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="current_course && current_review_member " class="post-container" style="padding-bottom:50px;">
|
||||
<div class="blue-title">{{current_course.name}}</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</span><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
<ul class="class-list f13 c-grey3">
|
||||
<li><span class="fl ml10 class-list-name hidden">教师</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':current_review_member.roles_id == 7,'checked': current_review_member.roles_id == 9}]"></span></li>
|
||||
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">助教</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':current_review_member.roles_id == 9, 'checked': current_review_member.roles_id == 7}]"></span></li>
|
||||
</ul>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a href="javascript:void(0);" ng-click="deal(1)" class="weixin-tab c-grey border-top">拒绝</a>
|
||||
<a href="javascript:void(0);" ng-click="deal(0)" class="weixin-tab link-blue2 border-top">同意</a>
|
||||
<div ng-show="status==0">
|
||||
<div class="blue-title">{{current_course.name}}</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</span><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
<ul class="class-list f13 c-grey3">
|
||||
<li><span class="fl ml10 class-list-name hidden">教师</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':current_review_member.roles_id == 7,'checked': current_review_member.roles_id == 9}]"></span></li>
|
||||
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">助教</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12', {'bg-grey':current_review_member.roles_id == 9, 'checked': current_review_member.roles_id == 7}]"></span></li>
|
||||
</ul>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a href="javascript:void(0);" ng-click="deal(1)" class="weixin-tab c-grey border-top">拒绝</a>
|
||||
<a href="javascript:void(0);" ng-click="deal(0)" class="weixin-tab link-blue2 border-top">同意</a>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="status==1 || status==2">
|
||||
<div class="blue-title">审批结果</div>
|
||||
<div class="f12 c-grey6" style="width:200px; margin:40px auto;"> <span class="f13 c-grey3">该申请已被处理,处理情况如下:</span>
|
||||
<ul class="mb15 mt5 ml10 new-tip">
|
||||
<li><span class="project-intro-dot">•</span>申请用户: {{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</li>
|
||||
<li><span class="project-intro-dot">•</span>申请角色: {{current_review_member.roles_id == 7 ? "助教" : "教师" }}</li>
|
||||
<li><span class="project-intro-dot">•</span>班级名称: {{current_course.name}}</li>
|
||||
<li><span class="project-intro-dot">•</span>处理结果: {{status == 1 ? "同意" : "拒绝"}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div ng-click="goClassMemberList();" class="btn2 bg-blue">知道了</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,16 +1,31 @@
|
|||
<div class="post-container">
|
||||
<div loading-spinner></div>
|
||||
<div ng-show="current_project && current_review_member" class="post-container" style="padding-bottom:50px;">
|
||||
<div class="blue-title">{{current_project.name}}</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</span><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
<ul class="class-list f13 c-grey3">
|
||||
<li><span class="fl ml10 class-list-name hidden">管理人员</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle',{'bg-grey':current_review_member.roles_id == 4,'checked': current_review_member.roles_id == 3}]"></span></li>
|
||||
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">开发人员</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle',{'bg-grey':current_review_member.roles_id == 3,'checked': current_review_member.roles_id == 4}]"></span></li>
|
||||
</ul>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a href="javascript:void(0);" ng-click="deal(1)" class="weixin-tab c-grey border-top">拒绝</a>
|
||||
<a href="javascript:void(0);" ng-click="deal(0)" class="weixin-tab link-blue2 border-top">同意</a>
|
||||
<div ng-show="status==1">
|
||||
<div class="blue-title">{{current_project.name}}</div>
|
||||
<div class="class-detail-row f13 c-grey3"><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.jpg" width="30" class="fl ml10 img-circle mt4" /><span class="fl mt10 ml10">{{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</span><img ng-src="/images/wechat/{{current_review_member.gender==0 ? 'male' : 'female'}}.png" width="15" class="fl ml10 mt10" /><div class="cl"></div> </div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml10">角色</span></div>
|
||||
<ul class="class-list f13 c-grey3">
|
||||
<li><span class="fl ml10 class-list-name hidden">管理人员</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle',{'bg-grey':current_review_member.roles_id == 4,'checked': current_review_member.roles_id == 3}]"></span></li>
|
||||
<li class="border-bottom-none"><span class="fl ml10 class-list-name hidden">开发人员</span><span ng-class="['login-box', 'fr', 'mr10', 'mt12','img-circle',{'bg-grey':current_review_member.roles_id == 3,'checked': current_review_member.roles_id == 4}]"></span></li>
|
||||
</ul>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a href="javascript:void(0);" ng-click="deal(1)" class="weixin-tab c-grey border-top">拒绝</a>
|
||||
<a href="javascript:void(0);" ng-click="deal(0)" class="weixin-tab link-blue2 border-top">同意</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-show="status==5 || status==7">
|
||||
<div class="blue-title">审批结果</div>
|
||||
<div class="f12 c-grey6" style="width:200px; margin:40px auto;"> <span class="f13 c-grey3">该申请已被处理,处理情况如下:</span>
|
||||
<ul class="mb15 mt5 ml10 new-tip">
|
||||
<li><span class="project-intro-dot">•</span>申请用户: {{current_review_member.realname == "" ? current_review_member.name : current_review_member.realname}}</li>
|
||||
<li><span class="project-intro-dot">•</span>申请角色: {{current_review_member.roles_id == 3 ? "管理人员" : "开发人员" }}</li>
|
||||
<li><span class="project-intro-dot">•</span>项目名称: {{current_project.name}}</li>
|
||||
<li><span class="project-intro-dot">•</span>处理结果: {{status == 7 ? "同意" : "拒绝"}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div ng-click="goProjectMemberList()" class="btn2 bg-blue">知道了</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
|
|||
|
||||
var course_id = $routeParams.id;
|
||||
var user_id = $routeParams.user_id;
|
||||
vm.status = 0;
|
||||
|
||||
if(!vm.current_course){
|
||||
$http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
|
||||
|
@ -42,20 +43,20 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
|
|||
course_id: course_id,
|
||||
user_id:user_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
if(response.data.status==-1){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.current_review_member = response.data.data;
|
||||
vm.status = response.data.status;
|
||||
console.log("review_member_info");
|
||||
console.log(response.data.data);
|
||||
}
|
||||
|
||||
if(!vm.current_review_member){
|
||||
vm.tip_2 = "该申请不存在或已被处理";
|
||||
vm.tip_2 = "该申请不存在";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
vm.deal = function(result){
|
||||
|
@ -67,7 +68,7 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
|
|||
}).then(function(response) {
|
||||
if (response.data.status == 0) {
|
||||
vm.alertService.showMessage('提示', response.data.message, function () {
|
||||
$location.path("/class").search({id: course_id,tag:1});
|
||||
$location.path("/class").search({id: course_id,tag: 1});
|
||||
});
|
||||
}
|
||||
else{
|
||||
|
@ -75,4 +76,8 @@ app.controller('ReviewClassMemberController', ['$scope', '$http', 'auth', 'confi
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
vm.goClassMemberList = function(){
|
||||
$location.path("/class").search({id: course_id,tag: 1});
|
||||
};
|
||||
}] );
|
|
@ -15,6 +15,7 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con
|
|||
|
||||
var project_id = $routeParams.id;
|
||||
var user_id = $routeParams.user_id;
|
||||
vm.status = 1;
|
||||
|
||||
if(!vm.current_project){
|
||||
$http.get(config.apiUrl+ 'projects/'+project_id+"?token="+auth.token()).then(
|
||||
|
@ -43,16 +44,17 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con
|
|||
project_id: project_id,
|
||||
user_id:user_id
|
||||
}).then(function(response){
|
||||
if(response.data.status!=0){
|
||||
if(response.data.status==-1){
|
||||
vm.alertService.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.status = response.data.status;
|
||||
vm.current_review_member = response.data.data;
|
||||
console.log("review_member_info");
|
||||
console.log(response.data.data);
|
||||
}
|
||||
|
||||
if(!vm.current_review_member){
|
||||
vm.tip_2 = "该申请不存在或已被处理";
|
||||
vm.tip_2 = "该申请不存在";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -80,4 +82,14 @@ app.controller('ReviewProjectMemberController', ['$scope', '$http', 'auth', 'con
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
vm.goProjectMemberList = function(){
|
||||
rms.save("project_master_members",[]);
|
||||
rms.save("project_develop_members",[]);
|
||||
rms.save("project_report_members",[]);
|
||||
rms.save("review_master_members",[]);
|
||||
rms.save("review_develop_members",[]);
|
||||
rms.save("tab_num",null);
|
||||
$location.path("/project").search({id: project_id,tag: 1});
|
||||
};
|
||||
}] );
|
Loading…
Reference in New Issue