customer-manager-cascader.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view>
  3. <u-popup :show="show" @close="_close" @open="_open" :round="10">
  4. <view>
  5. <luyj-tree v-slot:default="{item}" parent :trees="listData" :props="aprop" :isCheck="true" @sendValue="handleSendValue" :check-list="checkList">
  6. <!-- 内容插槽 -->
  7. <view>
  8. <view class="content-item">
  9. <view class="word">{{item.name}}</view>
  10. </view>
  11. </view>
  12. </luyj-tree>
  13. </view>
  14. </u-popup>
  15. </view>
  16. </template>
  17. <script>
  18. import {
  19. filterCustomerManager
  20. } from "@/utils/util";
  21. export default {
  22. data() {
  23. return {
  24. show: false,
  25. aprop: {
  26. id: 'id',
  27. label: 'label',
  28. children: 'children',
  29. multiple: true,
  30. checkStrictly: false, //不关联
  31. nodes: false, // nodes为false时,可以选择任意一级选项;nodes为true时只能选择叶子节点
  32. },
  33. listData : [],
  34. checkList : [],
  35. }
  36. },
  37. methods: {
  38. _show() {
  39. this.show = true;
  40. },
  41. _open() {
  42. // console.log('open');
  43. },
  44. _close() {
  45. this.show = false
  46. // console.log('close');
  47. },
  48. handleSendValue(value){
  49. console.log(value);
  50. },
  51. },
  52. created(){
  53. // 获取人员
  54. uni.$u.api.listDetpUser().then(res => {
  55. this.listData = filterCustomerManager(res.data);
  56. console.log(this.listData);
  57. })
  58. }
  59. }
  60. </script>