wagsorgz.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. watch:{
  35. departName:{
  36. handler(newVal, objVal) {
  37. this.querydepartName(newVal);
  38. },
  39. }
  40. },
  41. created(){
  42. this.querydepartName()
  43. uni.setStorageSync("orgType",3);
  44. },
  45. methods:{
  46. jump(s){
  47. console.log(s)
  48. this.$store.commit('SET_DEPARTID',s)
  49. this.$Router.push({name:'wagesuser'})
  50. },
  51. querydepartName(s){
  52. this.$http.get(this.userUrl,{params:{departName:s}}).then(res=>{
  53. console.log("res",res)
  54. this.tree=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>