orgz.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  4. <block slot="backText">返回</block>
  5. <block slot="content">组织架构</block>
  6. </cu-custom>
  7. <xiaolu-tree :checkList="checkList" v-if="tree.length>0" :props="prop" @sendValue="confirm" :isCheck="true" :treeNone="tree"></xiaolu-tree>
  8. </view>
  9. </template>
  10. <script>
  11. import XiaoluTree from'@/components/xiaolu-tree/tree.vue'
  12. import api from '@/api/api'
  13. export default {
  14. components: {
  15. XiaoluTree
  16. },
  17. data() {
  18. return {
  19. data:[],
  20. userUrl:'/sys/user/departList',
  21. departName:'',
  22. orgName:'',
  23. tree: [],
  24. checkList: [],
  25. backList: this.checkList,
  26. prop:{
  27. label: 'name',
  28. children: 'children',
  29. multiple:true,
  30. },
  31. max: 5,
  32. }
  33. },
  34. created(){
  35. this.querydepartName()
  36. uni.setStorageSync("orgType",1);
  37. },
  38. methods:{
  39. querydepartName(s){
  40. this.$http.get(this.userUrl,{params:{departName:s}}).then(res=>{
  41. console.log("res",res)
  42. this.tree=res.data.departName;
  43. }).catch(err => {
  44. console.log(err);
  45. });
  46. }
  47. }
  48. }
  49. </script>
  50. <style>
  51. .ins{
  52. background-color: #F1F1F1;
  53. width: 90%;
  54. height: 30px;
  55. margin:0 auto;
  56. border-radius:5px 5px 5px 5px;
  57. margin-top: 20px;
  58. }
  59. .s{
  60. list-style-type:none;
  61. margin-left: -40px;
  62. }
  63. .imgs{
  64. width: 15px;
  65. height: 15px;
  66. float: right;
  67. }
  68. .top{
  69. background-color: #5677AC;
  70. width: 100%;
  71. height: 40px;
  72. }
  73. </style>