detail-immune-appointment.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. var d = dialog({contentType:'load', skin:'bk-popup'});
  2. var pagetype = 49;
  3. var barCode;
  4. $(function(){
  5. var request = GetRequest();
  6. var barCode = request["barCode"];//barcode
  7. var guahaoTime = request["guahaoTime"];//挂号时间
  8. guahaoTime = guahaoTime.replace('T',' ');
  9. var jiuzhenTime = decodeURIComponent(request["jiuzhenTime"]);//就诊时间
  10. var jiezhongHospital = decodeURIComponent(request["jiezhongHospital"]);//接种医院
  11. var jiuzhenName = decodeURIComponent(request["jiuzhenName"]);//就诊人
  12. var idCard = request["idCard"];//身份证号
  13. var hospitalCard = request["hospitalCard"];//社保卡号
  14. var dataPhone = request["dataPhone"];//手机号
  15. var dataStatus = request["dataStatus"];///状态,1可用,2已取消
  16. var sectionType = request["dataStatus"];//坐诊类型--取消预约用
  17. var hospitalId = request["hospitalId"];//医院code
  18. var statusNm;
  19. if(dataStatus == 0){
  20. $(".div-cancel-btn").hide();
  21. $(".div-again-yuyue").show();
  22. statusNm = '已取消';
  23. }else{
  24. statusNm = '已预约';
  25. // TODO 如果预约开始时间早于当前时间,则不显示”取消预约“按钮
  26. var jsStartTime = new Date(jiuzhenTime).getTime();
  27. var curTime = new Date().getTime();
  28. if(curTime>jsStartTime) {
  29. $(".div-cancel-btn").hide();
  30. $(".div-again-yuyue").show();
  31. } else {
  32. $(".div-cancel-btn").show();
  33. $(".div-again-yuyue").hide();
  34. }
  35. }
  36. $(".left-status").addClass('clazz2').html(statusNm);
  37. $(".guahao-time").html(guahaoTime.substring(0,16));
  38. $(".jiuzheng-time").html(jiuzhenTime);
  39. $(".jiezhong-hospital").html(jiezhongHospital);
  40. $(".users-name").html(jiuzhenName);
  41. $(".idcard").html(idCard);
  42. $(".yibao-num").html(hospitalCard);
  43. $(".iphone-num").html(dataPhone);
  44. $(".main").show();
  45. $("#footer").show();
  46. d.close();
  47. $(".div-again-yuyue").on("click",function(){
  48. location.href = "immune-date.html?hospitalId="+hospitalId;
  49. });
  50. var params={};
  51. params.BarCode = barCode;
  52. params.OrgCode = hospitalId;
  53. params.SectionType = sectionType;
  54. params.strStart = jiuzhenTime;
  55. params.SSID = hospitalCard;
  56. params.PatientName = jiuzhenName;
  57. params.PatientID = idCard;
  58. params.PatientPhone = dataPhone;
  59. $(".div-cancel-btn").on("click",function(){
  60. sendPost("/patient/guahao/imm/UnResRegisterImmune", params, "json", "post", queryFailed, querySuccesss);
  61. });
  62. // getImmuneInfo();
  63. // bindEvents();
  64. })
  65. function querySuccesss(res){
  66. d.close();
  67. if(res.status == 200) {
  68. dialog({
  69. contentType: 'tipsbox',
  70. skin: 'bk-popup',
  71. content: res.msg
  72. }).show();
  73. } else {
  74. dialog({
  75. contentType: 'tipsbox',
  76. skin: 'bk-popup',
  77. content: '撤销失败'
  78. }).show();
  79. }
  80. }
  81. function queryFailed(res){
  82. d.close();
  83. if(res && res.msg) {
  84. dialog({
  85. contentType: 'tipsbox',
  86. skin: 'bk-popup',
  87. content: res.msg
  88. }).show();
  89. } else {
  90. dialog({
  91. contentType: 'tipsbox',
  92. skin: 'bk-popup',
  93. content: '撤销失败'
  94. }).show();
  95. }
  96. }