juminqianyue.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. var self,
  2. idCard,
  3. state;
  4. mui.plusReady(function(){
  5. self = plus.webview.currentWebview();
  6. state = self.state;
  7. idCard = self.idCard;
  8. //返回事件
  9. mui.back = function(){
  10. backAction();
  11. }
  12. plus.nativeUI.showWaiting();
  13. sendGet("doctor/patient/getPatientSignFamily",{idcard:idCard}, function(){
  14. plus.nativeUI.closeWaiting();
  15. mui.toast("请求失败");
  16. }, function(res){
  17. if(res.status == 200){
  18. var patientMsg = res.data;
  19. if(res.data.SignFamily.status>0){
  20. sendGet("doctor/admin-teams/team/members/"+res.data.SignFamily.patient,{}, null, function(res) {
  21. plus.nativeUI.closeWaiting();
  22. if(res.status == 200){
  23. var html = template('list_tmp',{data:[patientMsg,res.data],state:state})
  24. $(".c-main").html(html)
  25. bindEvent()
  26. }else{
  27. mui.toast('获取数据失败')
  28. }
  29. })
  30. }else{
  31. plus.nativeUI.closeWaiting();
  32. var html = template('list_tmp',{data:[patientMsg,{}],state:state})
  33. $(".c-main").html(html)
  34. bindEvent()
  35. }
  36. // Promise.all([peosonalMsg(res.data.code),teamMsg(res.data.code)]).then(function(datas){
  37. // plus.nativeUI.closeWaiting();
  38. // console.log(datas)
  39. // })
  40. }
  41. })
  42. //请求数据
  43. // function peosonalMsg(code){
  44. // return new Promise(function(resolve, reject){
  45. // sendGet("doctor/patient_group/patient", {code: code}, null, function(res) {
  46. // if(res.status == 200){
  47. // resolve(res.data)
  48. // }else{
  49. // plus.nativeUI.closeWaiting();
  50. // mui.toast('获取数据失败')
  51. // return
  52. // }
  53. // })
  54. // })
  55. // }
  56. // function teamMsg(code){
  57. // return new Promise(function(resolve, reject){
  58. // sendGet("doctor/admin-teams/team/members/"+code,{}, null, function(res) {
  59. // if(res.status == 200){
  60. // resolve(res.data)
  61. // }else{
  62. // plus.nativeUI.closeWaiting();
  63. // mui.toast('获取数据失败')
  64. // return
  65. // }
  66. // })
  67. // })
  68. // }
  69. function bindEvent(){
  70. $(".jm-btn").on('tap',function(){
  71. mui.openWindow({
  72. id: "jumindangan",
  73. url: "jumindangan.html",
  74. extras: {
  75. idCard:idCard,
  76. state:1
  77. }
  78. })
  79. })
  80. $(".jm-btn2").on('tap',function(){
  81. mui.openWindow({
  82. id: "zizhujiandang",
  83. url: "zizhujiandang.html",
  84. extras: {
  85. state:-1,
  86. name:self.name,
  87. idCard:self.idCard
  88. }
  89. })
  90. })
  91. }
  92. //关闭页面
  93. function backAction(){
  94. var jmda = plus.webview.getWebviewById('jumindangan');
  95. var dljd = plus.webview.getWebviewById('dailijiandang');
  96. if(dljd){dljd.close('none')}
  97. if(jmda){jmda.close('none')}
  98. mui.later(function(){
  99. self.close()
  100. }, 300);
  101. }
  102. })
  103. template.helper("setPhoto", function(p) {
  104. return getImgUrl(p);
  105. })
  106. template.helper("setSex", function(p) {
  107. if(p==1){return '男'}
  108. if(p==2){return '女'}
  109. })
  110. template.helper("setExpenses", function(p) {
  111. if(p=='01'){return '无补贴'}
  112. if(p=='02'){return '全补贴'}
  113. if(p=='03'){return '补个人承担部分(20)'}
  114. if(p=='04'){return '补统筹基金(70)'}
  115. })
  116. template.helper("setServer", function(o) {
  117. if(o.length>0){
  118. var arr = []
  119. $.map(o,function(item){
  120. arr.push(item.server_type_name)
  121. })
  122. return arr.join(',')
  123. }else{
  124. return ''
  125. }
  126. })