transfer.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="转派" @clickLeft="backAdd">
  4. <template slot="right">
  5. <u-button type="success" size="small" class="u-reset-button" @click="classification"
  6. text="选择分类"></u-button>
  7. </template>
  8. </uni-nav-bar>
  9. <view class="top-wrapper">
  10. <button class="search_btn" @click="getData()">搜索</button>
  11. <image class="menu_icon" src="~@/static/pda/menu.svg"></image>
  12. </view>
  13. <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
  14. :selectedData="selectedData" :localdata="classificationList" valueKey="id" textKey="name"
  15. childrenKey="children" />
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. selectedData: ['1'],
  23. }
  24. },
  25. onLoad(params) {
  26. },
  27. methods: {
  28. getData() {
  29. },
  30. //返回添加页
  31. backAdd() {
  32. uni.navigateBack();
  33. },
  34. classification() {
  35. this.$refs.treePicker._show();
  36. },
  37. confirm(id, name, rootCategoryLevelId) {
  38. this.categoryLevelId = id;
  39. this.tableList = [];
  40. this.getData();
  41. },
  42. getTreeList() {
  43. treeByPid({
  44. ids: [1]
  45. }).then(res => {
  46. this.classificationList = res;
  47. this.confirm(res[0].id, res[0].name)
  48. })
  49. },
  50. }
  51. }
  52. </script>
  53. <style>
  54. </style>