index.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. console.log(id)
  31. content.sys_enterpriseid = id;
  32. if (init) {
  33. content.pageNumber = 1
  34. content.pageTotal = 1
  35. }
  36. _Http.basic({
  37. "id": "20221013160602",
  38. content
  39. }).then(res => {
  40. console.log("客户财务信息", res)
  41. if (res.msg != '成功') return wx.showToast({
  42. title: res.data,
  43. icon: "none"
  44. })
  45. this.setData({
  46. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  47. "content.pageNumber": res.pageNumber + 1,
  48. "content.pageSize": res.pageSize,
  49. "content.pageTotal": res.pageTotal,
  50. "content.total": res.total,
  51. sys_enterpriseid: id
  52. })
  53. setTimeout(() => {
  54. this.selectComponent("#List").queryDefault()
  55. }, 300)
  56. })
  57. },
  58. toSearch() {
  59. wx.navigateTo({
  60. url: '/packageA/setclient/modules/financing/search/index?perams=' + JSON.stringify({
  61. sys_enterpriseid: this.data.sys_enterpriseid,
  62. "nacache": true,
  63. "pageNumber": 1,
  64. "pageSize": 20,
  65. "pageTotal": 1,
  66. "total": 0,
  67. "where": {
  68. "condition": ""
  69. }
  70. }),
  71. })
  72. }
  73. }
  74. })