nav-tab.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Vue.component('nav-tab', {
  2. template: '<div style="padding-top: 10px;">\
  3. <div class="ml20 mr20">\
  4. <div class="ui-grid" style="align-items: center;">\
  5. <label class="title c-999 c-f14">病种:</label>\
  6. <div class="ui-col-1 downList" @click="setDownList">\
  7. <p class="m0 p0 plr10 c-border cur-pit downList-value c-border-all">{{downListName}}</p>\
  8. <ul v-if="showDownList" class="m0 p0 c-border-b c-border-l c-border-r c-position-a downList-inner" style="overflow-y: auto; height: 100px;">\
  9. <li class="plr10 c-border-t cur-pit" v-for="(o, i) in diseaseList" @click.stop="selectDisease(o, i)">{{o.typeName}}</li>\
  10. </ul>\
  11. </div>\
  12. </div>\
  13. <div class="ui-grid" style="align-items: center;">\
  14. <label class="title c-999 c-f14">模板:</label>\
  15. <div class="search-warp ui-col-1">\
  16. <input class="inp-search" placeholder="请输入康复指导名称查询" v-model="searchKey" @input="onSearch"/>\
  17. </div>\
  18. </div>\
  19. </div>\
  20. <div>\
  21. <guidance-template-panel ref="guidanceTemplatePanel" :activetemplate="activetemplate"></guidance-template-panel>\
  22. </div>\
  23. </div>',
  24. props: [],
  25. data: function() {
  26. return {
  27. activetemplate: null,
  28. isLeader: storage.docInfo.isLeader,
  29. searchKey:'',
  30. diseaseList: [{type:'', typeName: '全部'}],
  31. downListName: '全部',
  32. downListValue: '',
  33. showDownList: false
  34. }
  35. },
  36. mounted: function() {
  37. var vm = this
  38. EventBus.$on('active-template', function(template) {
  39. vm.activetemplate = template
  40. })
  41. this.$refs.guidanceTemplatePanel.debounceTempList(vm.downListValue,vm.searchKey)
  42. this.selectType()
  43. },
  44. methods: {
  45. onSearch: function(){
  46. var vm = this
  47. this.$refs.guidanceTemplatePanel.debounceTempList(vm.downListValue,vm.searchKey)
  48. },
  49. selectDisease: function(o, i){
  50. var vm = this
  51. this.downListName = o.typeName
  52. this.downListValue = o.type
  53. this.showDownList = false
  54. this.$refs.guidanceTemplatePanel.debounceTempList(vm.downListValue,vm.searchKey)
  55. },
  56. setDownList: function(){
  57. this.showDownList = !this.showDownList
  58. },
  59. // 获取十大病种字典
  60. selectType: function(){
  61. var vm=this;
  62. var params={
  63. }
  64. rehaAPI.selectType(params).then(function(res){
  65. if(res.status==200){
  66. vm.diseaseList = vm.diseaseList.concat(res.data)
  67. }else{
  68. layer.msg(res.msg,{icon:5});
  69. }
  70. })
  71. },
  72. }
  73. })