index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. options: {
  4. addGlobalClass: true
  5. },
  6. properties: {
  7. },
  8. data: {
  9. sys_enterpriseid: 0,
  10. content: {
  11. "nacache": true,
  12. "pageNumber": 1,
  13. "pageSize": 10,
  14. "pageTotal": 1,
  15. "total": null,
  16. "where": {
  17. "condition": ""
  18. }
  19. },
  20. list: []
  21. },
  22. methods: {
  23. changeTotal() {
  24. this.setData({
  25. "content.total": this.data.content.total - 1
  26. })
  27. },
  28. getList(id, init) {
  29. let content = this.data.content;
  30. content.sys_enterpriseid = id;
  31. if (init) {
  32. content.pageNumber = 1
  33. content.pageTotal = 1
  34. }
  35. _Http.basic({
  36. "id": "20221013160602",
  37. content
  38. }).then(res => {
  39. console.log("客户财务信息", res)
  40. if (res.msg != '成功') return wx.showToast({
  41. title: res.data,
  42. icon: "none"
  43. })
  44. this.setData({
  45. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  46. "content.pageNumber": res.pageNumber + 1,
  47. "content.pageSize": res.pageSize,
  48. "content.pageTotal": res.pageTotal,
  49. "content.total": res.total,
  50. sys_enterpriseid: id
  51. })
  52. setTimeout(() => {
  53. this.selectComponent("#List").queryDefault()
  54. }, 300)
  55. })
  56. },
  57. }
  58. })