index.js 2.4 KB

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