appoint-doptroon.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Vue.component('appoint-doptroon', {
  2. template:
  3. '<div>\
  4. <div class="c-f16 c-border-b pb5 ui-grid middle search-wrapper">\
  5. <div>科&emsp;&emsp;室&emsp;&emsp;</div>\
  6. <div class=" ml30" id="search"><input class="h34 " v-model="keyword" @keyup.enter="searchItem" placeholder="请输入科室名称查询"/><span @click="searchItem"></span></div>\
  7. </div>\
  8. <ul class="clearfix">\
  9. <li class="w138 fl mb10 h28" v-for="(list, index) in doptroon">\
  10. <a v-show="ind != index" class="h28" href="javascript:void(0)" :title="list.name" @click="selDoptroon(index, list)">{{list.name}}</a>\
  11. <a v-show="ind == index" class="h28 active" href="javascript:void(0)" :title="list.name" @click="selDoptroon(index, list)">{{list.name}}</a>\
  12. </li>\
  13. </ul>\
  14. </div>',
  15. props: ['doptroon'],
  16. data: function () {
  17. return {
  18. ind: null,
  19. keyword: ''
  20. }
  21. },
  22. watch: {
  23. keyword: function (i) {
  24. // this.$parent.initData(i)
  25. }
  26. },
  27. mounted: function () {},
  28. methods: {
  29. selDoptroon: function (index, list) {
  30. this.ind = index
  31. this.$emit('seldoptroon', list)
  32. },
  33. searchItem: function () {
  34. this.$parent.initData(this.keyword)
  35. }
  36. }
  37. })