parent
99384f511d
commit
1e6be58e08
@ -0,0 +1,42 @@
|
|||||||
|
<template>
|
||||||
|
<VxeInput id="gdh" ref="gdhRef" v-model="gdh" placeholder="工单号" @change="gdhChange" clearable />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {EventBus} from "@/event-bus";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'GdhInput',
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
gdh:'',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.$refs.gdhRef.focus();
|
||||||
|
EventBus.$on('removeGdh', ()=>{
|
||||||
|
this.gdh=''
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
gdhChange(){
|
||||||
|
if (this.gdh.length===10){
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
EventBus.$emit('gdh', {
|
||||||
|
gdh:this.gdh
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
#gdh{
|
||||||
|
width:200px;
|
||||||
|
position: absolute;
|
||||||
|
top:8px;
|
||||||
|
right:30px;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in new issue