my-followup.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. $(function() {
  2. $(".c-lab-mor li").click(function() {
  3. $(".c-lab-mor li").removeClass("hit");
  4. $(this).addClass("hit");
  5. });
  6. });
  7. mui.plusReady(function() {
  8. queryList();
  9. });
  10. function queryList() {
  11. plus.nativeUI.showWaiting();
  12. var params = {};
  13. params.page = 1;
  14. params.pageSize = 10;
  15. sendPost("patient/followup/record", params, "json", "post", queryListFailed, queryListSuccess)
  16. }
  17. function queryListFailed(res) {
  18. if (res && res.msg) {
  19. plus.nativeUI.toast(res.msg);
  20. } else {
  21. plus.nativeUI.toast("随访数据加载失败");
  22. }
  23. }
  24. function queryListSuccess(res) {
  25. if (res.status == 200) {
  26. //成功
  27. showList(res.list);
  28. } else {
  29. //非200则为失败
  30. queryListFailed(res);
  31. }
  32. plus.nativeUI.closeWaiting();
  33. }
  34. /**
  35. * 显示查询结果
  36. * @param {Object} list
  37. */
  38. function showList(list) {
  39. for (var i = 0; i < list.length; i++) {
  40. var data = list[i];
  41. if (!data) {
  42. continue;
  43. }
  44. addRow(data.doctor, data.hospital, data.dept, data.type, data.name, data.czrq, data.status);
  45. }
  46. }
  47. function addRow(doctor, hospital, dept, type, name, czrq, status) {
  48. var ul = document.querySelector("#item");
  49. var li = document.createElement("li");
  50. li.onclick = function(){
  51. openWebview('image-followup.html');
  52. };
  53. var html = '<div class="fpart1">';
  54. if (status == 0) {
  55. html += '<span class="fr c-f12 ced5050 pr20">未完成</span>';
  56. } else {
  57. html += '<span class="fr c-f12 c4dcd70 pr20">完成</span>';
  58. }
  59. if (type == 1) {
  60. //问卷随访
  61. html += '<span class="iconhold fatb2 border-radius-circle"><i class="iconfont icon-wenjuan"></i></span> 问卷随访';
  62. } else if (type == 2) {
  63. //图文随访
  64. html += '<span class="iconhold fatb3 border-radius-circle"><i class="iconfont icon-suifangtuwen"></i></span> 图文随访';
  65. } else {
  66. //电话随访
  67. html += '<span class="iconhold fatb1 border-radius-circle"><i class="iconfont icon-suifangdianhua"></i></span> 电话随访';
  68. }
  69. html += '<span class="list-icon arrow-right"></span>';
  70. html += '</div>';
  71. html += '<div class="fpart2">';
  72. html += '<span class="faname">' + name + '</span> 随访时间:' + czrq;
  73. html += '</div>';
  74. html += '<div class="fpart3 c-nowrap">签约医生:' + doctor + ' (' + hospital + ' ' + dept + ')';
  75. html += '</div>';
  76. li.innerHTML = html;
  77. ul.appendChild(li);
  78. }