jiandangxiangqing.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. var self,
  2. msgData,//建档信息
  3. dataBase;//字典信息
  4. mui.plusReady(function(){
  5. self = plus.webview.currentWebview();
  6. // 获取字典
  7. plus.nativeUI.showWaiting()
  8. sendGet('doctor/patient/getArchiveComboList', {},function(){
  9. plus.nativeUI.closeWaiting();
  10. mui.toast('请求失败')
  11. }, function(res) {
  12. plus.nativeUI.closeWaiting();
  13. if (res.status==200) {
  14. dataBase = res.data;
  15. getRecord()
  16. }else{
  17. mui.toast('获取数据失败')
  18. }
  19. })
  20. //获取建档信息
  21. function getRecord(){
  22. sendPost('doctor/archives/findArchiveDetailsByCode', {code:self.code},function(){
  23. plus.nativeUI.closeWaiting();
  24. mui.toast('请求失败')
  25. }, function(res) {
  26. plus.nativeUI.closeWaiting();
  27. if (res.status==200) {
  28. msgData = res.data
  29. var html = template('list_tmp',{data:res.data,dataBase:dataBase})
  30. $('.main').html(html)
  31. bindEvent()
  32. }else{
  33. mui.toast('获取数据失败')
  34. }
  35. })
  36. }
  37. })
  38. function bindEvent(){
  39. $(".jm-btn").on('tap',function(){
  40. mui.openWindow({
  41. id: "dailiqianyue",
  42. url: "../../mine/html/dailiqianyue.html",
  43. extras: {
  44. name:msgData.sickName,
  45. idCard:msgData.identityCardNo,
  46. countryCode:msgData.zoneCode,
  47. countryName:msgData.zoneName,
  48. ssc:msgData.insurCardNo,
  49. mobile:msgData.homePhone,
  50. kind:1
  51. }
  52. })
  53. })
  54. }
  55. template.helper("setSex",function(s){
  56. if(s == 1){return "男"}
  57. if(s == 2){return "女"}
  58. else{return ''}
  59. })
  60. template.helper("setFamilyHis",function(p){
  61. if(p && p != '0'){
  62. var arr = p.split(',')
  63. var newArr = []
  64. $.map(arr,function(item,i){
  65. newArr.push(_.find(dataBase.familyHistory, function(o){ return o.code == item; }).value)
  66. })
  67. return newArr.join(',')
  68. }else{
  69. return '无'
  70. }
  71. })
  72. template.helper('setDisable',function(p){
  73. if(p){
  74. return _.find(dataBase.disability, function(o){ return o.code == p; }).value
  75. }else{
  76. return ''
  77. }
  78. })
  79. template.helper('setPayment',function(p){
  80. if(p){
  81. return _.find(dataBase.payment, function(o){ return o.code == p; }).value
  82. }else{
  83. return ''
  84. }
  85. })
  86. template.helper('setJob',function(p){
  87. if(p){
  88. return _.find(dataBase.occupation, function(o){ return o.code == p; }).value
  89. }else{
  90. return ''
  91. }
  92. })
  93. template.helper('setEdu',function(p){
  94. if(p){
  95. return _.find(dataBase.education, function(o){ return o.code == p; }).value
  96. }else{
  97. return ''
  98. }
  99. })
  100. template.helper("setState",function(s){
  101. if(s == 1){return "已签约"}
  102. if(s == 0){return "未签约"}
  103. else{return ''}
  104. })
  105. template.helper('setTimeF',function(o){
  106. return o.substring(0,10)
  107. })