resultList.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. (function () {
  2. Vue.component('resultlist', {
  3. template: '<div >\
  4. <div v-if="data && data.length>0">\
  5. <div v-for="item in data" style="margin-bottom:15px;cursor: pointer;" @click="go(item)">\
  6. <div class="result_list flex f_wrap" >\
  7. <div class="flex"><span class="des">就诊日期</span>:<span class="result">{{forMatterDate(item.event_date)}}</span></div>\
  8. <div class="flex"><span class="des">就诊类型</span>:<span class="result">{{(item.event_type==0 && \'门诊\') || (item.event_type==1 && \'住院\')}}</span></div>\
  9. <div class="flex"><span class="des text_s ">性别</span>:<span class="result">{{(item.patient_sex==1 && \'男\') || (item.patient_sex==2 && \'女\') || "" }}</span></div>\
  10. <div class="flex"><span class="des">出生日期</span>:<span class="result">{{forMatterDate(item.patient_birthday)}}</span></div>\
  11. <div class="flex"><span class="des text_s">姓名</span>:<span class="result">{{item.patient_name}}</span></div>\
  12. <div class="flex"><span class="des text_s">医生</span>:<span class="result">{{item.doctor}}</span></div>\
  13. <div class="flex"><span class="des text_s ">就诊医院</span>:<span class="result two_width">{{item.org_name}}</span></div>\
  14. <div class="flex"><span class="des text_s " >就诊科室</span>:<span class="result two_width">{{item.dept_name}}</span></div>\
  15. </div>\
  16. <div v-if="item.hl" class="zhaiyao" v-html="item.hl"></div>\
  17. </div>\
  18. <div class="block flex f_y_c f_x_e">\
  19. <el-pagination\
  20. @size-change="handleSizeChange"\
  21. background\
  22. @current-change="handleCurrentChange"\
  23. :current-page="currentPage"\
  24. :page-sizes="pageSizeArr"\
  25. :page-size="pageSize"\
  26. layout="total, sizes, prev, pager, next, jumper"\
  27. :total="total">\
  28. </el-pagination>\
  29. </div>\
  30. </div>\
  31. <nodata v-else ></nodata>\
  32. </div>',
  33. props: ['keyword','filters'],
  34. data: function () {
  35. return {
  36. currentPage:1,
  37. pageSizeArr:[15,30,50,100],
  38. pageSize:15,
  39. total:0,
  40. data:[],
  41. searchKey:''
  42. }
  43. },
  44. mounted: function () {
  45. },
  46. methods: {
  47. forMatterDate:function(date){
  48. return new Date(date).format('yyyy-MM-dd')
  49. },
  50. handleCurrentChange:function(val){ //page
  51. this.currentPage = val;
  52. this.getList()
  53. },
  54. handleSizeChange:function(val){// size
  55. this.pageSize=val;
  56. this.initData()
  57. },
  58. getList:function(){
  59. var vm=this;
  60. var params={
  61. page:this.currentPage,
  62. size:this.pageSize,
  63. keyword:this.keyword,
  64. filters:this.filters
  65. }
  66. GlobalEventBus.$emit('setLoading',{
  67. loading:true
  68. });
  69. bigDataOutApi.text_search(params).then(function(res){
  70. GlobalEventBus.$emit('setLoading');
  71. vm.data=res.detailModelList;
  72. vm.total=res.totalCount;
  73. if(vm.currentPage = 1){
  74. GlobalEventBus.$emit('getSearchData',{data:vm.data})
  75. }
  76. }).catch(function(err){
  77. GlobalEventBus.$emit('setLoading');
  78. })
  79. },
  80. initData:function(){ //初始化数据
  81. this.currentPage = 1;
  82. this.getList()
  83. },
  84. go:function(item){
  85. var date = this.forMatterDate(item.event_date),
  86. orgName = item.org_name,
  87. profileId=item.rowkey,
  88. eventType=item.event_type,
  89. searchWord=this.keyword
  90. var url = httpRequest.server+'/profile/app/templateDetails/html/hospitalIndex.html?'+
  91. 'date='+date+'&orgName='+orgName+'&profileId='+profileId+'&eventType='+eventType+
  92. '&searchWord='+searchWord
  93. window.open(url)
  94. }
  95. },
  96. watch: {
  97. resultList(val){
  98. }
  99. }
  100. })
  101. })()