statistics.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. toastr.options = {
  2. "closeButton": true,
  3. "positionClass": "toast-top-center"
  4. }
  5. function showSuccessMessage(msg) {
  6. toastr.success(msg)
  7. }
  8. function showErrorMessage(msg) {
  9. toastr.error(msg)
  10. }
  11. function showWarningMessage(msg) {
  12. toastr.warning(msg)
  13. }
  14. function showInfoMessage(msg) {
  15. toastr.info(msg)
  16. }
  17. new Vue({
  18. el: '#app',
  19. data: {
  20. modal:"",
  21. type:"",
  22. status:"",
  23. name:"",
  24. isDanger:"1",
  25. pagesize:10,
  26. total:"",
  27. pagetotal:'',//总页数
  28. currentPage:1,//当前页数
  29. tablelist:[],
  30. types:[],
  31. Statics:{},
  32. wujilu:false,
  33. },
  34. mounted(){
  35. var vm=this
  36. vm.getModal()
  37. vm.getDatas()
  38. vm.gettypes()
  39. },
  40. methods:{
  41. //获取筛查数据模型
  42. getModal:function(){
  43. var vm=this
  44. jbscAPI.screenStatics().then(function(res){
  45. if(res.status==200){
  46. vm.Statics=res.data;
  47. }else{
  48. showErrorMessage(res.msg);
  49. }
  50. })
  51. },
  52. //获取数据
  53. getDatas:function(){
  54. var vm=this
  55. var params={
  56. diseaseType: vm.type, //疾病类型
  57. dealType: vm.status, //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
  58. patientName: vm.name, //搜索居民的姓名
  59. isDanger:vm.isDanger, //是否高危预警(0否 1是)
  60. pageNo: vm.currentPage,
  61. pageSize: vm.pagesize
  62. }
  63. jbscAPI.getResultList(params).then(function(res){
  64. if(res.status==200){
  65. vm.wujilu=false
  66. vm.total=res.data.num
  67. vm.pagetotal= Math.ceil(res.data.num/vm.pagesize)
  68. vm.tablelist=res.data.data;
  69. if(vm.tablelist.length==0){
  70. vm.wujilu=true
  71. }
  72. }else{
  73. showErrorMessage(res.msg);
  74. }
  75. })
  76. },
  77. gettypes:function(){
  78. var vm=this
  79. jbscAPI.getSpecialDisease().then(function(res){
  80. if(res.status==200){
  81. vm.types=res.data;
  82. }else{
  83. showErrorMessage(res.msg);
  84. }
  85. })
  86. },
  87. gettable:function(type){
  88. var vm=this
  89. vm.isDanger=type
  90. vm.search(1)
  91. },
  92. //页面跳转
  93. search:function(page){
  94. var vm=this
  95. vm.currentPage=page
  96. vm.getDatas()
  97. },
  98. //转诊
  99. zhuanzhen:function(){
  100. showInfoMessage("PC上暂不支持,请打开手机端疑似高危记录进行转诊预约!")
  101. },
  102. //健康教育
  103. jkjy:function(data){
  104. var receiver={"code":data.patientCode,name:data.patientName}
  105. sessionStorage.setItem("jbsc-jkwzreceiver",JSON.stringify(receiver))
  106. location.href="../../../../health-education/index.html?origin=jbsc"
  107. },
  108. //筛查
  109. shaicha:function(data,isNew){
  110. var vm=this
  111. if(isNew){
  112. console.log(data)
  113. //再次筛查数+1
  114. vm.Statics.againCount++
  115. var vm=this
  116. top.layer.open({
  117. type: 2,
  118. area: ['820px', '648px'],
  119. shade: 0.5,
  120. id:"questionnaire",
  121. title: '筛选统计',
  122. fixed: true, //不固定
  123. maxmin: true,
  124. closeBtn:1,
  125. shift: 5,
  126. shadeClose: false, //点击遮罩关闭层
  127. content: 'questionnaire.html?fliter_code='+data.templateCode+'&fliter_title='+data.templateTitle+'&resident_code='+data.patientCode+'&resident_name='+data.patientName
  128. });
  129. return ;
  130. }
  131. layer.open({
  132. type: 2,
  133. offset: 'rb', //右下角弹出
  134. id:"filter_type",
  135. area: ['280px', '100%'],
  136. shade: 0.5,
  137. title: false,
  138. fixed: true, //不固定
  139. maxmin: false,
  140. closeBtn:0,
  141. shift: 5,
  142. shadeClose: true, //点击遮罩关闭层
  143. content: 'filter_type.html'
  144. });
  145. },
  146. //健康跟踪
  147. jkgz:function(id){
  148. var vm=this
  149. //跳转到筛查结果页面
  150. showInfoMessage(id+"筛查结果")
  151. },
  152. }
  153. })