orgz.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div style="background-color: #FFFFFF;">
  3. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">组织架构</block>
  6. </cu-custom>
  7. <div class="ins">
  8. <div style="height: 3px;"></div>
  9. <input placeholder="🔍 搜索" style="text-align: center;" v-model="departName" />
  10. </div>
  11. <br>
  12. <div style="height: 10px;width: 100%;background-color: #F1F1F1 ;"></div>
  13. <div style="height: 10px;width: 100%;"></div>
  14. <span style="margin-left: 20px; color: #A3A7B1;">{{orgName.departName}}</span>
  15. <view class="cu-list menu radius" >
  16. <view class="cu-item arrow animation-slide-bottom" :style="[{animationDelay: '0.1s'}]" v-for='(item,index) in data'>
  17. <navigator class="content" @click="jump(item.departId)" hover-class="none">
  18. <text class="text-grey">{{item.orgCodeTxt}} ({{item.count}})</text>
  19. </navigator>
  20. </view>
  21. </view>
  22. </div>
  23. </template>
  24. <script>
  25. import api from '@/api/api'
  26. export default {
  27. data() {
  28. return {
  29. data:[],
  30. userUrl:'/sys/user/departList',
  31. departName:'',
  32. orgName:''
  33. }
  34. },
  35. watch:{
  36. departName:{
  37. handler(newVal, objVal) {
  38. this.querydepartName(newVal);
  39. },
  40. }
  41. },
  42. created(){
  43. this.querydepartName()
  44. },
  45. methods:{
  46. jump(s){
  47. console.log(s)
  48. this.$store.commit('SET_DEPARTID',s)
  49. this.$Router.push({name:'teams'})
  50. },
  51. querydepartName(s){
  52. this.$http.get(this.userUrl,{params:{departName:s}}).then(res=>{
  53. console.log("res",res)
  54. this.data=res.data.departName;
  55. this.orgName=res.data.orgName;
  56. }).catch(err => {
  57. console.log(err);
  58. });
  59. },
  60. ret(){
  61. this.$Router.push({name:'index'})
  62. },
  63. }
  64. }
  65. </script>
  66. <style>
  67. .ins{
  68. background-color: #F1F1F1;
  69. width: 90%;
  70. height: 30px;
  71. margin:0 auto;
  72. border-radius:5px 5px 5px 5px;
  73. margin-top: 20px;
  74. }
  75. .s{
  76. list-style-type:none;
  77. margin-left: -40px;
  78. }
  79. .imgs{
  80. width: 15px;
  81. height: 15px;
  82. float: right;
  83. }
  84. .top{
  85. background-color: #5677AC;
  86. width: 100%;
  87. height: 40px;
  88. }
  89. </style>