You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
897 B

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <script>
  2. import {getSiteAndBuByUserName} from "../../../api/eam/eam";
  3. export default {
  4. name: "buSelect",
  5. data(){
  6. return{
  7. userBuList:[],
  8. }
  9. },
  10. methods:{
  11. handleQueryBu(){
  12. let params = {
  13. username: this.$store.state.user.name,
  14. }
  15. getSiteAndBuByUserName(params).then(({data}) => {
  16. if (data && data.code === 0) {
  17. this.userBuList = data.rows
  18. }else {
  19. this.$message.warning(data.message)
  20. }
  21. }).catch((error)=>{
  22. this.$message.error(error)
  23. })
  24. },
  25. },
  26. created() {
  27. this.handleQueryBu()
  28. }
  29. }
  30. </script>
  31. <template>
  32. <el-select v-on="$listeners" v-bind="$attrs" style="width: 100%">
  33. <slot></slot>
  34. <el-option
  35. v-for = "i in userBuList"
  36. :key = "i.id"
  37. :label = "i.buDesc"
  38. :value = "i.id">
  39. </el-option>
  40. </el-select>
  41. </template>
  42. <style scoped>
  43. </style>