signing-welcome.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. $(function() {
  2. $('#require_sign').click(function() {
  3. //location.href = "signing-doctors.html";
  4. //判断患者是否有签约情况
  5. var userAgent = localStorage.getItem("wlyyAgent");
  6. var request = GetRequest();
  7. var code = request.code;
  8. if(!userAgent){//如果未签约,则跳转去签约管理页面,引导用户去登录页面
  9. location.href = "signing_management.html?code="+code;
  10. // location.href = "signing_management.html";
  11. }else{
  12. //已登录后,判断是否有签约关系
  13. var url = "/patient/family_contract/getSignMessage",
  14. userAgentObj = JSON.parse(userAgent),
  15. params = {patientCode: userAgentObj.represented?userAgentObj.represented:userAgentObj.uid};
  16. sendPost(url, params, "json", "post", function(res){
  17. console.log();
  18. var request = GetRequest();
  19. var code = request.code;
  20. location.href = "signing_management.html?code="+code;
  21. }, function(res){
  22. var list = res.list;
  23. if(list && list.length > 0){
  24. for(i=0; i<list.length; i++){
  25. var item = list[i];
  26. if(item.signType == 2 && item.signStatus == 1){
  27. dialog({
  28. content: "您已签约家庭医生,无法再次签约",
  29. contentType: "tipsbox",
  30. skin:'bk-popup'
  31. }).show();
  32. }else if(item.signType == 2 && item.signStatus == 0){
  33. dialog({
  34. content: "您已提交签约申请,无法再次签约",
  35. contentType: "tipsbox",
  36. skin:'bk-popup'
  37. }).show();
  38. }
  39. }
  40. }else{
  41. //判断去年是否有已过期的签约记录
  42. if(request.isOverdue){
  43. location.href = "../../xuqian/html/information.html";
  44. }else{
  45. location.href = "select-doctor.html";
  46. }
  47. }
  48. });
  49. }
  50. });
  51. })