12345678910111213141516171819202122232425262728293031323334353637 |
- Vue.component('appointment-search-bar', {
- template: '<div class="clearfix">\
- <div id="searchPhone" class="pl15 dataCell form-group c-position-r">\
- <input id="kw" v-model="keyword" placeholder="输入社保卡或身份证号码" @blur="search" @keyup.13="search" class="form-control inline w260 ml5 pr30" type="text" >\
- </div></div>',
- props: ["card"],
- data: function() {
- return {
- keyword: "",
- idCard:''
- }
- },
- watch: {
- card(val){
- this.keyword = val
- this.search()
- }
- },
- mounted: function() {
- var vm = this;
- EventBus.$on("show-search", function() {
- vm.isShow = true
- })
- },
- methods: {
- search: function(event) {
- if(event && event.type =="keydown" && event.keyCode != 13 || this.keyword.length <= 0) {
- return
- }
- var kw = document.getElementById("kw")
- kw.blur()
- EventBus.$emit("appointment-search",{
- data: {"keyword": this.keyword}
- })
- }
- }
- })
|