hospital-filter.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. (function(){
  2. Vue.component('hospital-filter',{
  3. template:'<div style="height: 400px;overflow: auto;margin-bottom: 50px;">\
  4. <el-tabs v-model="activeName" :stretch="true">\
  5. <el-tab-pane label="等级医院" name="0">\
  6. <div class="ptb10 c-f14 plr15 c-border-b ui-grid c-cursor-p" :class="{\'bgc-f2f3f4\':hospitalCode==item.code}" v-for="(item,index) in hopitalList" :key="index" @click="selHospitalItem(item)" >\
  7. <div class="ui-col-1">\
  8. {{item.name}}\
  9. </div>\
  10. </div>\
  11. </el-tab-pane>\
  12. <el-tab-pane label="社区医院" name="1">\
  13. <div class="ptb10 c-f14 plr15 c-border-b ui-grid c-cursor-p" :class="{\'bgc-f2f3f4\':hospitalCode==item.code}" v-for="(item,index) in chopitalList" :key="index" @click="selHospitalItem(item)" >\
  14. <div class="ui-col-1">\
  15. {{item.name}}\
  16. </div>\
  17. </div>\
  18. </el-tab-pane>\
  19. </el-tabs>\
  20. <div id="footer">\
  21. <div class="c-row btn-wrap c-border-top fr">\
  22. <div class="div-foot-btn mr20" @click="resetClick">\
  23. <a href="#" class="c-666 f-fs16">取消</a>\
  24. </div>\
  25. <div class="div-foot-btn active" @click="confirmClick">\
  26. <a href="#" class="c-666 f-fs16">确认</a>\
  27. </div>\
  28. </div>\
  29. </div>\
  30. </div>',
  31. props:['chopitalList','hopitalList'],
  32. data: function(){
  33. return {
  34. activeName:0,
  35. hospitalCode:"",
  36. hospitalItem:{},
  37. }
  38. },
  39. mounted: function(){
  40. },
  41. methods: {
  42. resetClick:function(){
  43. this.$emit('vuedals:close', {});
  44. },
  45. confirmClick:function(){
  46. var vm = this;
  47. if(vm.hospitalCode){
  48. //触发刷新
  49. this.$emit('vuedals:close', {
  50. hospitalItem: vm.hospitalItem,
  51. hospitalCode: vm.hospitalCode,
  52. activeName:vm.activeName,
  53. });
  54. }else{
  55. vm.$message.error("请选择医院")
  56. }
  57. },
  58. selHospitalItem:function(item){
  59. var vm = this;
  60. vm.hospitalItem = item
  61. vm.hospitalCode = item.code
  62. }
  63. }
  64. });
  65. })()