index.js 2.2 KB

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