selectUser.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <My_listbox ref="List" @getlist="getList" bottomHeight="70">
  3. <view style="height: 10px" />
  4. <user-list :list="list" @onClick="onClick" />
  5. </My_listbox>
  6. </template>
  7. <script>
  8. import userList from "../../components/userList.vue";
  9. export default {
  10. components: { userList },
  11. data() {
  12. return {
  13. content: {
  14. where: {
  15. condition: "",
  16. status: "启用",
  17. },
  18. },
  19. total: 0,
  20. list: [],
  21. };
  22. },
  23. onLoad(options) {
  24. this.getList(true);
  25. uni.setNavigationBarTitle({
  26. title: options.title || "选择用户",
  27. });
  28. },
  29. methods: {
  30. getList(init = false) {
  31. if (this.paging(this.content, init)) return;
  32. this.$Http
  33. .basic({
  34. id: "20240410142002",
  35. content: this.content,
  36. })
  37. .then((res) => {
  38. console.log("选择负责人", res);
  39. this.$refs.List.RefreshToComplete();
  40. if (this.cutoff(res.msg)) return;
  41. this.total = res.total;
  42. (this.list =
  43. res.pageNumber == 1 ? res.data : this.list.concat(res.data)),
  44. this.colors;
  45. this.content = this.$refs.List.paging(this.content, res);
  46. });
  47. },
  48. onClick(item) {
  49. this.$Http.routeSelected(item);
  50. },
  51. },
  52. };
  53. </script>
  54. <style></style>